package com.cssl.fmmall.service.imp;

import com.cssl.fmmall.dao.IndexImgMapper;
import com.cssl.fmmall.entity.IndexImg;
import com.cssl.fmmall.service.IndexImgService;
import com.cssl.fmmall.vo.ResStatus;
import com.cssl.fmmall.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class IndexImgServiceImp implements IndexImgService {
    @Autowired
    private IndexImgMapper indexImgMapper;

    @Override
    public Result listIndexImgs() {
        List<IndexImg> indexImgs = indexImgMapper.listIndexImgs();
        if(indexImgs.isEmpty()){
            return new Result(ResStatus.NO,"fail",null);
        }else{
            return new Result(ResStatus.OK,"success",indexImgs);
        }
    }
}
